/*
 * @Description: 数据模型
 * @Author: wind-lc
 * @version: 1.0
 * @Date: 2022-02-15 15:42:39
 * @LastEditTime: 2022-03-03 15:21:13
 * @FilePath: \cscec-pms-admin\src\views\project\projectManagementPlanning\projectManagementPlanningSchedule\model.js
 */
import OrgTreeSelect from '@/components/OrgTreeSelect'
// 状态
const status = [
  {
    value: 0,
    label: '待签收'
  },
  {
    value: 1,
    label: '待提交'
  },
  {
    value: 2,
    label: '审核中'
  },
  {
    value: 3,
    label: '审核通过'
  },
  {
    value: 4,
    label: '审核不通过'
  },
]
// 项目管理策划明细表搜索选项
const searchOption = [
  // {
  //   name: '所属单位',
  //   valueKey: 'searchQuery',
  //   type: OrgTreeSelect,
  // },
  {
    name: '项目名称',
    valueKey: 'projectName',
    type: 'BaseInput',
    disabled: true
  },
  {
    name: '状态',
    value: 'status',
    type: 'select',
    data: status
  }
]
// 项目管理策划明细表表头
const columns = [
  {
    title: '序号',
    width: 70,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '分公司',
    ellipsis: true,
    width: 100,
    dataIndex: 'branchComName'
  },
  {
    title: '项目名称',
    ellipsis: true,
    width: 100,
    dataIndex: 'projectName'
  },
  {
    title: '是否重点项目',
    dataIndex: 'isImportant',
    width: 100,
    align: 'center',
    customRender: (text) => {
      return text === 1 ? '是' : '否'
    }
  },
  {
    title: '策划项目',
    ellipsis: true,
    width: 100,
    dataIndex: 'planProject'
  },
  {
    title: '完成期限',
    width: 100,
    align: 'center',
    dataIndex: 'deadline'
  },
  {
    title: '签收时间',
    width: 100,
    align: 'center',
    dataIndex: 'signTime',
    customRender: (text) => {
      return text || '--'
    }
  },
  {
    title: '实际完成时间',
    width: 100,
    align: 'center',
    dataIndex: 'actualCompleteTime',
    customRender: (text) => {
      return text || '--'
    }
  },
  {
    title: '版本信息',
    dataIndex: 'version',
    width: 100,
    align: 'center',
    scopedSlots: { customRender: 'version' }
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 120,
    align: 'center',
    customRender: (text) => {
      return status.find(el => el.value === text)?.label
    }
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 180,
    fixed: 'right',
    align: 'center',
    scopedSlots: { customRender: 'operation' }
  }
]
// 版本记录表头
const columns1 = [
  {
    title: '序号',
    width: 80,
    align: 'center',
    customRender: (text, record, index) => {
      return index + 1
    }
  },
  {
    title: '版本号',
    dataIndex: 'version',
    customRender: (text) => {
      return 'V' + text
    }
  },
  {
    title: '版本创建时间',
    dataIndex: 'versionCreateTime'
  },
  {
    title: '创建人',
    dataIndex: 'versionOperator'
  },
  {
    title: '操作',
    dataIndex: 'operation',
    width: 120,
    fixed: 'right',
    scopedSlots: { customRender: 'operation' }
  }
]
export {
  searchOption,
  columns,
  columns1
}
